package com.gf.framework.xxljobdemo;

import com.gf.framework.common.utils.list.GfArrayList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author gaofei
 * @date 2022/5/23 20:32
 */
@SpringBootApplication(scanBasePackages = {"com.gf"})
@EnableAspectJAutoProxy(proxyTargetClass = true)
@Slf4j
public class XxlJobDemoApplication {
    @Data
    @AllArgsConstructor
    public static class A {
        private String name;
    }

    public static void main(String[] args) {
        List<A> aList = new ArrayList<>();
        aList.add(new A("1234567"));
        aList.add(new A("1234567r23t23t2"));
        aList.add(new A("123t2t2t24567"));

        log.info(aList.getClass().getName());
        log.info(aList.getClass().getSimpleName());
        log.info("{}", aList.getClass().hashCode());


        Stream<A> aStream = aList.stream();

        Stream<String> stringStream =  aStream.map(new Function<A, String>() {
            @Override
            public String apply(A a) {
                return a.name;
            }
        });

        List<String> stringList = stringStream.collect(Collectors.toList());

        SpringApplication.run(XxlJobDemoApplication.class, args);
    }

    private static void t(long a) {
        System.out.println(a);
    }
}
